<div class="box-body">
    <form class="layui-form" action="{:url()}" style="width: 500px;" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">父级规则</label>
            <div class="layui-input-block">
                {php}$selected=isset($info['pid'])?$info['pid']:0;{/php}
                <select name="pid" lay-search>
                    <option value="0">顶级规则</option>
                    {volist name="list" id="vo"}
                        <option value="{$vo.id}"
                        {eq name="vo.id" value="$selected"}selected="selected"{/eq}
                        >{$vo.html} {$vo.title}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" placeholder="标题" value="{$info.title|default=''}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">规则</label>
            <div class="layui-input-block">
                <input type="text" name="name" placeholder="/admin/auth.rule/index" value="{$info.name|default=''}"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图标</label>
            <div class="layui-input-inline">
                <input type="text" name="icon" placeholder="fa fa-edit" value="{$info.icon|default=''}"
                       class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">支持font-awesome字体</div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-inline">
                    <input type="number" name="sort" value="{$info.sort|default='0'}" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="1" title="启用"
                    {php}if(!isset($info)||$info['status']==1):echo 'checked';endif{/php}
                    >
                    <input type="radio" name="status" value="0" title="禁用"
                    {php}if(isset($info)&&$info['status']==0):echo 'checked';endif{/php}
                    >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">是否菜单</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="is_menu" value="1" lay-text="是|不是" lay-skin="switch"
                    {php}if(!isset($info)||$info['is_menu']==1):echo 'checked';endif{/php}
                    >
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea"
                          placeholder="这个规则的说明">{$info.remark|default=''}</textarea>
            </div>
        </div>
        <input type="hidden" name="id" value="{$info.id|default=''}">
    </form>
</div>
